
 /**
 * 上海中赢金融信息服务有限公司
 * Copyright (c) 2017, chinazyjr All Rights Reserved.
 */
package com.sys.kafka.core.consumer.listener;

import java.util.HashMap;
import java.util.Map;

/**
 * <b>Description：</b> TODO <br/>
 * <b>ClassName：</b> MessageContainer <br/>
 * <b>@author：</b> mobing <br/>
 * <b>@date：</b> 2017年7月13日 下午3:25:35 <br/>
 * <b>@version: </b>  <br/>
 */
public class MessageContainer {

    private String topic;

    private MessageListener messageListener;
    
    private static Map<String, MessageListener> listeners = new HashMap<>();
    
    public static void put(String topic,MessageListener listener){
        listeners.put(topic, listener);
    }
    
    public static MessageListener get(String topic){
        return listeners.get(topic);
    }
    
    public static Map<String, MessageListener> getAll(){
        return listeners;
    }
    
    public MessageContainer(String topic,MessageListener messageListener){
        this.topic = topic;
        this.messageListener = messageListener;
    }

    /**
     * topic
     *
     * @return  the topic
     */
    
    public String getTopic() {
        return topic;
    }

    /**
     * @param topic the topic to set
     */
    public void setTopic(String topic) {
        this.topic = topic;
    }

    /**
     * messageListener
     *
     * @return  the messageListener
     */
    
    public MessageListener getMessageListener() {
        return messageListener;
    }

    /**
     * @param messageListener the messageListener to set
     */
    public void setMessageListener(MessageListener messageListener) {
        this.messageListener = messageListener;
    }

 
    
}
